﻿using System;
using System.Collections.Generic;
using System.Text;

namespace FSLib.App.SimpleUpdater.Dialogs
{
	class HiddenUpdater:System.Windows.Forms.Form
	{
		protected override void SetVisibleCore(bool value)
		{
			base.SetVisibleCore(false);
		}

		public HiddenUpdater()
		{
			var u = Updater.Instance;

			u.NoUpdatesFound += (s, e) => Environment.Exit(0);
			u.Error += (s, e) => Environment.Exit(0);
			u.ExternalUpdateStarted += (s, e) => Environment.Exit(0);
			u.UpdateCancelled += (s, e) => Environment.Exit(0);

			Updater.CheckUpdateSimple();
		}
	}
}
